import React from "react";
import { DatePicker ,message,Button} from "antd";

class Antd extends React.Component {
  constructor(props){
    super(props);
    this.state={
      date:'未选择'
    }
  }
  handleChange=value=>{
    message.info(`您选择的日期是: ${value?value.format('YYYY年MM月DD日'):'未选择'}`)
    console.log(value);
    this.setState({date:value?value.format('YYYY年MM月DD日'):'未选择'})
  }
  render() {
    return (
      <div>
        <DatePicker onChange={this.handleChange}></DatePicker>
        <h6>{this.state.date}</h6>
        <Button type="primary" onClick={()=>{let result=message.info('hello=world');console.log(result)}}>点我</Button>
      </div>
    );
  }
}

export default Antd;
